package com.piece.mall.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@NoArgsConstructor
@Table(name = "oms_payment_info")
@ApiModel(value = "支付")
public class OmsPaymentInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", length = 11)
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "order_sn")
    @ApiModelProperty(value = "订单号（对外业务号）")
    private String orderSn;

    @Column(name = "order_id")
    @ApiModelProperty(value = "订单主键")
    private Long orderId;

    @Column(name = "channel_trade_no")
    @ApiModelProperty(value = "支付渠道交易流水号")
    private String channelTradeNo;

    @Column(name = "total_amount")
    @ApiModelProperty(value = "支付总金额")
    private Long totalAmount;

    @Column(name = "payment_subject")
    @ApiModelProperty(value = "交易内容")
    private String paymentSubject;

    @Column(name = "payment_status")
    @ApiModelProperty(value = "支付状态")
    private String paymentStatus;

    @Column(name = "payment_channel")
    @ApiModelProperty(value = "支付类型", notes = "1=支付宝, 2=微信")
    private String paymentChannel;

    @Column(name = "payment_channel_code")
    @ApiModelProperty(value = "客户端类型")
    private String paymentChannelCode;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    @Column(name = "confirm_time")
    @ApiModelProperty(value = "确认时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date confirmTime;

    @Column(name = "callback_content")
    @ApiModelProperty(value = "回调内容")
    private String callbackContent;

    @Column(name = "callback_time")
    @ApiModelProperty(value = "回调时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date callbackTime;
}
